package file;

import java.io.File;

public class DeleteFileDemo {
    public static void main(String[] args) {
        for (int i = 0; i < 100; i++) {
//            File file = new File("test"+i+".txt");
            File file = new File("demo.txt");

            if(file.exists()){
                file.delete();
                System.out.println("已删除");
            }else{
                System.out.println("文件不存在");
            }
        }

    }
}
